package com.spic.business.factory;

import com.spic.business.Remote7daysForecast;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * Remote7daysForecastFallbackFactory
 *
 * @author xuxiaochang@chinasofi.com
 * @date 2022/4/8
 */
@Component
public class Remote7daysForecastFallbackFactory implements FallbackFactory<Remote7daysForecast>
{
    Logger logger = LoggerFactory.getLogger(Remote7daysForecastFallbackFactory.class);
    @Override
    public Remote7daysForecast create(Throwable cause)
    {
        return new Remote7daysForecast()
        {
            @Override
            public void daysForecat()
            {
                logger.error("获取天气接口异常，请稍后重试");
            }
        };
    }
}
